package com.cd.music.dto;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author yxl 余秀良
 * @version 1.0
 * @description: 封装订单需要的参数
 * @date 2018年03月05日  上午11:55
 * @address: 四川成都
 */
public class OrderDto extends BaseDto {
    /**
     * 数据id
     */
    private String id;
    /**
     * 订单编号
     */
    private String orderId;
    /**
     * 收货地址编号
     */
    private String addressId;
    /**
     * 订单编号
     */
    private String orderCode;
    /**
     * 支付状态
     * 0未付款,1已付款,2已发货,3已签收
     */
    private String payStatus;
    /**
     * 订单总金额
     */
    private BigDecimal orderAmount;
    /**
     * 收货地址
     */
    private String deliveryAddress;
    /**
     * 买家编号
     */
    private String userId;
    /**
     * 联系电话
     */
    private String phone;
    /**
     * 收货人姓名
     */
    private String userName;

    /**
     * Ｆ码
     */
    private String fCode;
    /**
     * Ｆ码id
     */
    private String fCodeId;

    /**
     * 商品数量
     */
    private int goodsAmount = 1;
    /**
     * 购买的商品数量
     */
    private String goodsId;
    /**
     * 商品名字
     */
    private String goodsName;
    /**
     * 商品价格
     */
    private BigDecimal goodsPrice;

    /**
     * 省
     */
    private String province;

    /**
     * 市
     */
    private String city;
    /**
     * 区
     */
    private String area;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 下单时间
     */
    private String orderTime;


    public static Builder newBuilder() {
        return new Builder();
    }


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getOrderCode() {
        return orderCode;
    }

    public void setOrderCode(String orderCode) {
        this.orderCode = orderCode;
    }

    public String getPayStatus() {
        return payStatus;
    }

    public void setPayStatus(String payStatus) {
        this.payStatus = payStatus;
    }

    public BigDecimal getOrderAmount() {
        return orderAmount;
    }

    public void setOrderAmount(BigDecimal orderAmount) {
        this.orderAmount = orderAmount;
    }

    public String getDeliveryAddress() {
        return deliveryAddress;
    }

    public void setDeliveryAddress(String deliveryAddress) {
        this.deliveryAddress = deliveryAddress;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getfCode() {
        return fCode;
    }

    public void setfCode(String fCode) {
        this.fCode = fCode;
    }

    public String getfCodeId() {
        return fCodeId;
    }

    public void setfCodeId(String fCodeId) {
        this.fCodeId = fCodeId;
    }

    public int getGoodsAmount() {
        return goodsAmount;
    }

    public void setGoodsAmount(int goodsAmount) {
        this.goodsAmount = goodsAmount;
    }

    public String getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(String goodsId) {
        this.goodsId = goodsId;
    }

    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public BigDecimal getGoodsPrice() {
        return goodsPrice;
    }

    public void setGoodsPrice(BigDecimal goodsPrice) {
        this.goodsPrice = goodsPrice;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getArea() {
        return area;
    }

    public void setArea(String area) {
        this.area = area;
    }

    public OrderDto() {

    }

    private OrderDto(Builder builder) {
        setToken(builder.token);
        setPageIndex(builder.pageIndex);
        setPageSize(builder.pageSize);
        setId(builder.id);
        setOrderCode(builder.orderCode);
        setPayStatus(builder.payStatus);
        setOrderAmount(builder.orderAmount);
        setDeliveryAddress(builder.deliveryAddress);
        setUserId(builder.userId);
        setPhone(builder.phone);
        setUserName(builder.userName);
        setfCode(builder.fCode);
        setfCodeId(builder.fCodeId);
        setGoodsAmount(builder.goodsAmount);
        setGoodsId(builder.goodsId);
        setGoodsName(builder.goodsName);
        setGoodsPrice(builder.goodsPrice);
        setProvince(builder.province);
        setCity(builder.city);
        setArea(builder.area);
        setCreateTime(builder.createTime);
    }

    public static Builder builder() {
        return new Builder();
    }

    public Date getCreateTime() {
        return createTime != null ? (Date) createTime.clone() : null;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime != null ? (Date) createTime.clone() : null;
    }

    public String getOrderTime() {
        return orderTime;
    }

    public void setOrderTime(String orderTime) {
        this.orderTime = orderTime;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public String getAddressId() {
        return addressId;
    }

    public void setAddressId(String addressId) {
        this.addressId = addressId;
    }


    public static final class Builder {
        private String id;
        private String orderCode;
        private String payStatus;
        private BigDecimal orderAmount;
        private String deliveryAddress;
        private String userId;
        private String phone;
        private String userName;
        private String fCode;
        private String fCodeId;
        private int goodsAmount;
        private String goodsId;
        private String goodsName;
        private BigDecimal goodsPrice;
        private String province;
        private String city;
        private String area;
        private String token;
        private Integer pageIndex;
        private Integer pageSize;
        private Date createTime;
        /**
         * 订单编号
         */
        private String orderId;
        /**
         * 收货地址编号
         */
        private String addressId;

        private Builder() {
        }

        public OrderDto build() {
            return new OrderDto(this);
        }

        public Builder id(String id) {
            this.id = id;
            return this;
        }

        public Builder orderCode(String orderCode) {
            this.orderCode = orderCode;
            return this;
        }

        public Builder payStatus(String payStatus) {
            this.payStatus = payStatus;
            return this;
        }

        public Builder orderAmount(BigDecimal orderAmount) {
            this.orderAmount = orderAmount;
            return this;
        }

        public Builder deliveryAddress(String deliveryAddress) {
            this.deliveryAddress = deliveryAddress;
            return this;
        }

        public Builder userId(String userId) {
            this.userId = userId;
            return this;
        }

        public Builder phone(String phone) {
            this.phone = phone;
            return this;
        }

        public Builder userName(String userName) {
            this.userName = userName;
            return this;
        }

        public Builder fCode(String fCode) {
            this.fCode = fCode;
            return this;
        }

        public Builder fCodeId(String fCodeId) {
            this.fCodeId = fCodeId;
            return this;
        }

        public Builder goodsAmount(int goodsAmount) {
            this.goodsAmount = goodsAmount;
            return this;
        }

        public Builder goodsId(String goodsId) {
            this.goodsId = goodsId;
            return this;
        }

        public Builder goodsName(String goodsName) {
            this.goodsName = goodsName;
            return this;
        }

        public Builder goodsPrice(BigDecimal goodsPrice) {
            this.goodsPrice = goodsPrice;
            return this;
        }

        public Builder province(String province) {
            this.province = province;
            return this;
        }

        public Builder city(String city) {
            this.city = city;
            return this;
        }

        public Builder area(String area) {
            this.area = area;
            return this;
        }

        public Builder token(String token) {
            this.token = token;
            return this;
        }

        public Builder pageIndex(Integer pageIndex) {
            this.pageIndex = pageIndex;
            return this;
        }

        public Builder pageSize(Integer pageSize) {
            this.pageSize = pageSize;
            return this;
        }

        public Builder createTime(Date createTime) {
            this.createTime = createTime != null ? (Date) createTime.clone() : null;
            return this;
        }

        public Builder orderId(String orderId) {
            this.orderId = orderId;
            return this;
        }

        public Builder addressId(String addressId) {
            this.addressId = addressId;
            return this;
        }
    }
}
